package com.core.cloudbusiness.system.depart.controller;

import com.core.cloudbusiness.system.depart.service.CloudSystemDepartService;
import com.core.cloudcommon.CommonResult;
import com.core.cloundbusinessapi.sheet.process.dto.CloudSheetProcessDTO;
import com.core.cloundbusinessapi.sheet.process.vo.CloudSheetProcessVO;
import com.core.cloundbusinessapi.system.depart.dto.CloudSystemDepartDTO;
import com.core.cloundbusinessapi.system.depart.dto.CloudSystemDepartQueryDTO;
import com.core.cloundbusinessapi.system.depart.vo.CloudSystemDepartVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author =====Lqj=====
 * @className CloudSystemDepartController
 * @description
 * @create 2024/11/29 14:58
 **/

@RestController
@RequestMapping("/cloud/sys/depart")
public class CloudSystemDepartController {

    @Autowired
    private CloudSystemDepartService cloudSystemDepartService;

    @PostMapping("/query")
    public CommonResult<List<CloudSystemDepartQueryDTO>> query(@Validated @RequestBody CloudSystemDepartVO cloudSystemDepartVO) {
        List<CloudSystemDepartQueryDTO> query = cloudSystemDepartService.query(cloudSystemDepartVO);
        return CommonResult.OK(query);

    }

    @PostMapping("/add")
    public CommonResult<CloudSystemDepartDTO> add(@Validated @RequestBody CloudSystemDepartVO cloudSystemDepartVO) {
        CloudSystemDepartDTO add = cloudSystemDepartService.add(cloudSystemDepartVO);
        return CommonResult.OK(add);
    }





}
